//
//  NewsDetailsTwoTableViewCell.m
//  FootBallTest_huang
//
//  Created by lanou3g on 15/5/30.
//  Copyright (c) 2015年 lanou3g.com. All rights reserved.
//

#import "NewsDetailsTwoTableViewCell.h"

@implementation NewsDetailsTwoTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setNewsDetailModel:(NewsDetailsModel *)newsModle{
    if (_newsDetailsModle == newsModle) {
        return;
    }
    _newsDetailsModle = newsModle;
    [self.webView setDelegate:self];
//    NSLog(@"%@",newsModle);
    [self.webView loadHTMLString:newsModle.content baseURL:nil];
    self.webView.scrollView.scrollEnabled = NO;

}


-(void)webViewDidStartLoad:(UIWebView *)webView
{
//    NSLog(@"load ing");
    [_activityIndicationView startAnimating];
    _activityIndicationView.hidden=NO;
}

-(void)webViewDidFinishLoad:(UIWebView *)webView{
//    NSLog(@"finish ing,%@",webView.scrollView);
    [_activityIndicationView stopAnimating];
    _activityIndicationView.hidden=YES;
    CGRect frame = webView.frame;
    frame.size = webView.scrollView.contentSize;
    frame.size.height = webView.scrollView.contentSize.height+10;
    webView.frame = frame;
    self.height = frame.size.height;
    if ([self.target respondsToSelector:self.action]) {
        [self.target performSelector:self.action withObject:nil];
    }
    
    
}


@end
